From: Florian Müllner Date: Tue, 31 Jul 2018 04:37:20 +0000 (+0200) Subject: windowManager: Fix switch animation between non-adjacent workspaces X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~4^2~15 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=91da3789bc12fab060c96b4e098b599d7380c578;p=gnome-shell.git windowManager: Fix switch animation between non-adjacent workspaces Commit e5c95b910d refactored the workspace animation to also handle animations that involve all surrounding workspaces, but due to an ill-advised review comment (guess whose) it broke the animation for non-neighboring workspaces. Update the code to handle correctly whether in a given direction: - we have the target workspace of a given index - we have a neighboring workspace - we don't need to animate anything https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/182 --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index a88d4f9a0..d2d441d0c 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -1856,8 +1856,14 @@ var WindowManager = new Lang.Class({ let curWs = workspaceManager.get_workspace_by_index (from); for (let dir of Object.values(Meta.MotionDirection)) { - let ws = curWs.get_neighbor(dir); - if (ws == curWs || (to >= 0 && ws.index() != to)) { + let ws = null; + + if (to < 0) + ws = curWs.get_neighbor(dir); + else if (dir == direction) + ws = workspaceManager.get_workspace_by_index(to); + + if (ws == null || ws == curWs) { switchData.surroundings[dir] = null; continue; }